﻿.bb-g-search {
    --bb-global-search-top: 92px;
    --bb-global-search-left: 10px;
    --bb-global-search-right: 10px;
    display: flex;
    align-items: center;
    color: var(--bb-header-dropdown-color);
    border: var(--bs-border-width) solid var(--bb-header-dropdown-border-color);
    border-radius: var(--bs-border-radius);
    padding: 0.25rem 0.75rem;
    width: 168px;
    margin-bottom: .5rem;
    font-size: .875rem;
    transition: border-color .3s linear;
}

    .bb-g-search:hover {
        --bb-header-dropdown-border-color: #fff;
    }

    .bb-g-search input {
        width: 100%;
        background-color: transparent;
        border: none;
        line-height: 25px;
        padding: 0;
        margin: 0 .5rem;
        cursor: pointer;
    }

        .bb-g-search input::placeholder {
            color: rgba(var(--bb-header-dropdown-color-rgb), 0.5);
        }

    .bb-g-search i {
        cursor: pointer;
    }

.search-dialog-mask {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    background-color: #000;
    opacity: 0.3;
}

    .search-dialog-mask:not(.show),
    .search-dialog:not(.show) {
        display: none;
    }

.search-dialog {
    position: fixed;
    top: var(--bb-global-search-top);
    left: var(--bb-global-search-left);
    right: var(--bb-global-search-right);
    z-index: 50;
    height: calc(100vh - 160px);
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    border-radius: var(--bs-border-radius);
    border: var(--bs-border-width) solid var(--bs-border-color);
    overflow: auto;
    padding: 1rem;
}

.search-dialog-input {
    border-radius: 10px;
    border: var(--bs-border-width) solid var(--bs-border-color);
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    transition: border-color .3s linear;
}

    .search-dialog-input input {
        background-color: transparent;
        border: none;
        line-height: 25px;
        padding: 0;
        margin: 0 .5rem;
    }

        .search-dialog-input input::placeholder {
            color: rgba(var(--bs-body-color-rgb), 0.5);
        }

    .search-dialog-input:has(input:focus) {
        border-color: var(--bb-primary-color);
    }

.search-dialog-status {
    border-bottom: var(--bs-border-width) solid var(--bs-border-color);
    padding: 0 1rem;
    font-size: .75rem;
    display: block;
    margin: 0 -1rem .5rem -1rem;
    color: rgba(var(--bs-body-color-rgb), 0.5);
    line-height: 34px;
}

.search-dialog-main {
    display: flex;
    height: calc(100% - 82px);
    margin: 0 -.5rem;
}

.search-dialog-menu {
    flex-basis: 240px;
    margin-left: 0.5rem;
    padding: .5rem .25rem;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    font-size: 13px;
    display: none;
}

    .search-dialog-menu ::deep .search-dialog-menu-item {
        padding: .25rem .5rem;
        display: block;
        color: var(--bs-body-color);
        border-radius: var(--bs-border-radius);
    }

        .search-dialog-menu ::deep .search-dialog-menu-item:not(:last-child) {
            margin-bottom: .125rem;
        }

        .search-dialog-menu ::deep .search-dialog-menu-item:hover {
            background-color: rgba(var(--bb-primary-color-rgb), 0.4);
        }

        .search-dialog-menu ::deep .search-dialog-menu-item.active {
            background-color: rgba(var(--bb-primary-color-rgb), 0.5);
        }

.search-dialog-list {
    flex: 1;
    overflow: auto;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: .25rem;
}

    .search-dialog-list .search-dialog-item {
        display: block;
        border: var(--bs-border-width) solid var(--bs-border-color);
        border-radius: var(--bs-border-radius);
        padding: .5rem;
        position: relative;
        transition: border-color .3s linear, background-color .3s linear;
    }

        .search-dialog-list .search-dialog-item:not(:first-child) {
            margin-top: .5rem;
        }

        .search-dialog-list .search-dialog-item:hover {
            border: var(--bs-border-width) solid var(--bs-border-color);
        }

        .search-dialog-list .search-dialog-item a {
            color: var(--bs-body-color);
        }

        .search-dialog-list .search-dialog-item .badge {
            --bs-badge-border-radius: 50%;
            position: absolute;
            top: 4px;
            margin-left: 4px;
        }

        .search-dialog-list .search-dialog-item .search-dialog-item-sub {
            font-size: .75rem;
            margin-top: .25rem;
            opacity: .8;
        }

        .search-dialog-list .search-dialog-item li {
            padding: .125rem;
            border-radius: var(--bs-border-radius);
            transition: background-color .3s linear;
        }

            .search-dialog-list .search-dialog-item li:not(:first-child) {
                margin-top: .125rem;
            }

            .search-dialog-list .search-dialog-item li > a {
                display: block;
                padding: .125rem;
                font-size: .75rem;
            }

            .search-dialog-list .search-dialog-item li:hover {
                background-color: rgba(var(--bb-primary-color-rgb), 0.5);
            }

        .search-dialog-list .search-dialog-item ::deep key {
            display: inline-block;
            margin: 0;
            color: var(--bb-primary-color);
            font-weight: bold;
        }

    .search-dialog-list .search-dialog-empty-template {
        text-align: center;
        padding: 24px;
        display: block;
    }

@media (min-width: 768px) {
    .search-dialog-menu.show {
        display: block;
    }

    .bb-g-search {
        --bb-global-search-top: 72px;
        --bb-global-search-left: 20px;
        --bb-global-search-right: 20px;
        margin-bottom: 0;
        margin-right: .5rem;
    }

    .search-dialog {
        width: 700px;
        margin: 0 auto;
    }
}

@media (min-width: 992px) {
    .search-dialog {
        width: 900px;
    }
}
